package com.yaohuan.controller;

/**
 * @author YaoHuan
 * @ClassName FloatTest
 * @Description TODO
 * @Date 2023/3/31 21:59
 */
public class FloatTest {
    public static void main(String[] args) {
        double precision = 0.000001; //10^-6
        double d1=2.0d-1.9d;
        double d2= 0.1d;
        if (Math.abs(d1 - d2) < precision) {
            // 在精度范围内，d1等于d2
            System.out.println("true");
        }
    }
}
